import { API_CONFIG } from "../config/index.js"
import  request from "../api/index.js"

export const getDepartmentList = () =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getDepartmentListInfoApi,{},"GET",2000)
}

export const getDepartmentListInfoHandler = () =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getDepartmentListInfoApi,{},"GET",2000)
}

export const addDepartmentListInfoHandler = (data) =>{
    return request(API_CONFIG.addDepartmentListInfoApi,data,"POST",2000)
}

export const updateDepartmentListInfoHandler = (id,data) =>{
    return request(API_CONFIG.updateDepartmentListInfoApi(id),data,"PUT",2000)
}

export const delDepartmentListInfoHandler = (id) =>{
    return request(API_CONFIG.delDepartmentListInfoApi(id),{},"DELETE",2000)
}